package org.firebug.spring.boot.jpa.repository.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.firebug.common.bean.dict.Gender;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity(name = "t_user")
@DynamicInsert
@DynamicUpdate
public class UserEntity implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    private String name;
    private BigDecimal salary;
    @Enumerated(EnumType.STRING)
    private Gender gender;
    @Version
    private Integer version;
    private boolean deleted;
    private Timestamp createAt;
    private Timestamp updateAt;
}
